<script setup lang="ts">
import { useMemberStore } from '@/stores/index'
const store = useMemberStore()

const addProfile = () => {
  store.setProfile({
    id: 1,
    name: '小赵',
    age: '23',
    token: 'token123',
  })
}

type BannerItem = {
  id: string
  imgUrl: string
}

const addToken = async () => {
  const res = await uni.http<BannerItem[]>({
    url: '/home/banner',
    data: { distributionSite: 1 },
  })
  console.log('res', res)
}
</script>

<template>
  <view>profile: {{ store.profile }}</view>
  <view class="my">
    <button @tap="addProfile">新增profile</button>
    <button @tap="addToken">新增profile</button>
  </view>
</template>

<style lang="scss">
//
</style>
